package com.hotel.tv.repositories;

import com.autumn.domain.repositories.DefaultEntityRepository;
import com.hotel.tv.entities.Order;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * </p>
 *
 * @description TODO
 * @author: 老码农
 * @create: 2020-04-03 11:48
 **/
@Repository
public interface OrderRepository extends DefaultEntityRepository<Order> {

    /**
     *
     * @param userId
     * @return
     */
    @Select("select id,title,order_time as orderTime,user_id as userId,number" +
            " from b_order where user_id=#{userId}")
    List<Order> orders(@Param("userId") long userId);

}
